package test;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Auther: xiang
 * @Date: 2019/9/17 11:17
 * @Description:
 */
public class demo {
    public static void main(String[] args) {
        User user = new User(15,"李白");
        User user1 = new User(188,"李xiao白");
        User user2= new User(164,"5李白");
        User user3 = new User(165,"李55白");
        ArrayList<User> users = new ArrayList<>();
        users.add(user);
        users.add(user1);
        users.add(user2);
        users.add(user3);
        List<Integer> collect = users.stream().map(User::getAge).collect(Collectors.toList());
        System.out.println(collect);
    }

}